﻿using System;
using System.Data.Entity;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TypeWrite.MVC4.Models;
using System.Data.Entity.Infrastructure;
using WebMatrix.WebData;
using System.Configuration;

namespace TypeWrite.Tests.Controllers
{
    [TestClass]
    public class DataSourceControllerTest
    {
        [TestMethod]
        public void CreateDatabase()
        {
            using (TypeWrite.Data.TypeWriteDataContext db = new Data.TypeWriteDataContext(ConfigurationManager.ConnectionStrings["TypeWriteNewDB"].ConnectionString))
            {
                if (db.DatabaseExists())
                    db.DeleteDatabase();

                db.CreateDatabase();

                Assert.IsTrue(db.DatabaseExists());
            }
        }

        [TestMethod]
        public void EnsureRole()
        {
            Assert.IsTrue(true);
        }
    }
}
